<template>
	<!-- 工具页面 -->
	<view>
		<global-navgation title="工具"></global-navgation>
		<view class="image-container"  >			
			<view @click="tip(index)" :key="index"  v-for="(item,index) in lists" :style="{backgroundImage:'linear-gradient(180deg, rgba(57, 101, 255, 0.6) 0%, rgba(57, 101, 255, 0.3) 100%),url('+item.image+')'}">{{item.title}}</view>
		<!-- 	<view @click="product"></view>
			<view @click="consult">1对1VIP咨询</view> -->
		</view>
		<view class="separate">
			<view class="line">
			</view>
			<view class="font-container">
				表格下载
			</view>
		</view>
		<view class="button-container">
			<view class="button-item">
				<text class="iconfont icon-xiazai" style="font-size: 30rpx;"></text><span>21天服务跟踪表</span>
			</view>
			<view class="button-item">
				<text class="iconfont icon-xiazai" style="font-size: 30rpx;"></text><span>健康服务调查表</span>
			</view>
		</view>
	</view>
</template>

<script>
	import globalNavgation from '../../components/globalNavgation.vue'
	export default {
		name: 'edit',
		components: {
			globalNavgation
		},
		data() {
			return {
				lists:[],
				token:"",
				tokens:''
			}
		},
		
		mounted(){
			// 初始化获取数据
			this.__initClassData()	
		},
		onLoad(){
			uni.getStorage({
			    key: 'token',
			    success:  res=> {
					this.tokens=res.data
					console.log('mmm',this.tokens)
			    }
			});
		},
		methods:{
			__initClassData() {
				this.$api.get({
					url: '/article/config/get_list',
					data:{token:this.tokens,type:'tool'}
				}).then(res => {
						this.lists=res.list.data
						console.log(res)
					})
				},
			product(){
				uni.navigateTo({
					url:'../product/product'
				})
			},
			tip(i){
				if(!i){
					return
				}else if(i===1){
					this.product()
				}else if(i===2){
					this.consult()
				}
			},
			consult(){
				uni.navigateTo({
					url:'../consult/consult'
				})
			}
		}
	}
</script>

<style>
	.image-container {
		margin-top: 20rpx;
	}

	.image-container view {
		font-family: PingFang SC;
		font-style: normal;
		font-weight: 600;
		font-size: 56rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 300rpx;
		display: block;
		width: 654rpx;
		height: 300rpx;
		vertical-align: top;
		margin: 0 auto;
		margin-bottom: 32rpx;
		border-radius: 8px;
		background-size: 654rpx 300rpx
	}


	.separate {
		position: relative;
		width: 554rpx;
		height: 34rpx;
		margin: 0 auto;
		margin-top: 46rpx;
	}

	.separate .line {
		position: absolute;
		top: 0;
		right: 0;
		left: 0;
		bottom: 0;
		width: 80%;
		height: 2rpx;
		margin: auto;
		background: rgba(0, 0, 0, 0.1);
	}

	.separate .font-container {
		width: 120rpx;
		height: 100%;
		position: absolute;
		font-family: PingFang SC;
		font-style: normal;
		font-weight: normal;
		font-size: 24rpx;
		top: 0;
		right: 0;
		left: 0;
		bottom: 0;
		margin: auto;
		text-align: center;
		background-color: #FFFFFF;
		color: rgba(0, 0, 0, 0.45);
	}

	.button-container {
		width: 614rpx;
		height: 68rpx;
		margin: 0 auto;
		margin-top: 64rpx;
		display: flex;
	}
	.button-container .button-item{
		width: 300rpx;
		height: 100%;
		font-family: PingFang SC;
		font-style: normal;
		font-weight: 550;
		font-size: 28rpx;
		border: 1px solid rgba(57, 101, 255, 0.2);
		box-sizing: border-box;
		border-radius: 20px;
		color: rgba(57, 101, 255, 1);
		text-align: center;
		line-height: 68rpx;
		letter-spacing:2rpx
	}
	.button-container .button-item:first-child{
		margin-right: 14rpx;
	}
</style>